package com.perfma.xtest.tool;

import com.google.common.collect.Lists;
import com.google.common.collect.Sets;

import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * @author: junhui.si
 * @date: 2021-01-11 17:52
 **/
public class GuavaDemo {
    public static void main(String[] args) throws UnsupportedEncodingException {
//        List<String> threadGroupNameListOfScript = Lists.newArrayList("5", "2", "3", "4", "4");
//        List<String> threadGroupNameListOfScene = Lists.newArrayList("5", "6", "7", "8", "4");
//        Sets.SetView<String> diff = Sets.difference(Sets.newHashSet(threadGroupNameListOfScene), Sets.newHashSet(threadGroupNameListOfScript));
//        Sets.SetView<String> diff2 = Sets.difference(Sets.newHashSet(threadGroupNameListOfScript), Sets.newHashSet(threadGroupNameListOfScene));
//        System.out.println(threadGroupNameListOfScript);
//        System.out.println(threadGroupNameListOfScene);
//        System.out.println(diff);
//        System.out.println(diff2);

//        String selectSeries = "162363812_hdsfbsjdf晟达宝盛";
//        int index = selectSeries.indexOf("_");
//        Long sceneReportId = Long.parseLong(selectSeries.substring(0, index));
//        System.out.println(sceneReportId);
//        String series = selectSeries.substring(index+1);
//        System.out.println(series);
        byte[] ipAddressByteArray = "10.25.15.14".getBytes("UTF-8");
        long workerId = ((ipAddressByteArray[ipAddressByteArray.length - 2] & 0B11) << Byte.SIZE)
                + (ipAddressByteArray[ipAddressByteArray.length - 1] & 0xFF);
        System.out.println(workerId);
    }
}
